<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      :root {
        --color: red;
        --height: 500px;
      }
      .container {
        --d: -360deg;
        width: 800px;
        height: var(--height);
        border: 1px solid var(--color);
        margin: 50px auto;
        animation: totate linear 5s infinite;
      }
      .box {
        --d: 360deg;
        width: 400px;
        height: calc(var(--height) / 2);
        border: 1px solid #000;
        margin: 50px auto;
        background-color: bisque;
        animation: totate linear 5s infinite;
      }

      @keyframes totate {
        to {
          transform: rotate(var(--d));
        }
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="box">
        
      </div>
    </div>
  </body>
</html>
